<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>校园二手书市场管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" th:href="@{/favicon.ico}" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{./css/font.css}">
    <link rel="stylesheet" th:href="@{./css/xadmin.css}">
    <link rel="stylesheet" th:href="@{https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css}">
    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js}"></script>
    <script th:src="@{./lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{./js/xadmin.js}"></script>
    <style>
        .layui-form-label {
            width: 180px;
        }
        .layui-form-item .layui-input-inline {
            width: 50%;
        }
        img[src=""],img:not([src]){
            opacity:0;
        }

    </style>

</head>
<body>
<!--引入顶部-->
<div th:insert="~{commons/commons::mytopbar}"></div>


<!-- 中部开始 -->
<div class="wrapper">
    <!-- 左侧菜单开始 -->
    <div class="left-nav">
        <div id="side-nav">
            <!--引入中间-->
<!--            <div th:insert="~{commons/commons::mymidul}"></div>-->

            <!-- 中部左侧菜单开始 -->
            <ul id="nav" >
                <li class="list" current>
                    <a href="./index.html">
                        <i class="iconfont">&#xe761;</i>
                        首页
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="iconfont">&#xe70b;</i>
                        管理员管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li th:class="current">
                            <a th:href="@{/Administratorlist}">
                                <i class="iconfont">&#xe6a7;</i>
                                管理员信息列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list">
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        用户管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li th:class="current">
                            <a th:href="@{/BackUserInfolist}">
                                <i class="iconfont">&#xe6a7;</i>
                                查看用户信息
                            </a>
                        </li>

                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        图书管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu opened">
                        <li th:class="current">
                            <a th:href="@{/Booklist}">
                                <i class="iconfont">&#xe6a7;</i>
                                图书信息列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        图书分类图标管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li th:class="current">
                            <a th:href="@{/Categoryicongonglist}">
                                <i class="iconfont">&#xe6a7;</i>
                                修改分类图标/名字
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        订单管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li th:class="current">
                            <!--                     <a th:href="@{/Orderslist}" th:class="${active=='dingdanguianli'?'nav-link active':'active'}">-->
                            <a th:href="@{/Orderslist}">
                                <i class="iconfont">&#xe6a7;</i>
                                订单信息列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        轮播图管理
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                        <li th:class="current">
                            <a th:href="@{/swiperdataback}">
                                <i class="iconfont">&#xe6a7;</i>
                                修改轮播图
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        意见反馈查看
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu" style="display:none">
                        <li th:class="current">
                            <a th:href="@{/wxfeedbacklist}">
                                <i class="iconfont">&#xe6a7;</i>
                                用户反馈信息
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        评论查看
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu" >
                        <li th:class="current">
                            <a th:href="@{/Commentlist}">
                                <i class="iconfont">&#xe6a7;</i>
                                评论信息
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="list" >
                    <a href="javascript:;">
                        <i class="layui-icon">&#xe60c;</i>
                        上传图片
                        <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu" >
                        <li th:class="current">
                            <a th:href="@{/myuploadfile.html}">
                                <i class="iconfont">&#xe6a7;</i>
                                上传图片
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
            <!-- 中部左侧菜单结束 -->

        </div>
    </div>
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <!-- 中部开始 -->
            <div class="wrapper">
                <!-- 右侧主体开始 -->
                <div class="page-content">
                    <div class="content">

                        <!-- 右侧内容框架，更改从这里开始 -->
                        <form class="layui-form"  th:action="@{/Bookaddtijiao}" method="post">
<!--添加时不加goods_id   修改时，最好也不要去修改其它的自增长的类型-->
                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>cat_id
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text" name="cat_id" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>Integer类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_name
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="goods_name" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_price
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="goods_price" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>Integer类型
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_number
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text" name="goods_number" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>Integer类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>school
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="school" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_oldnew
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="goods_oldnew" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_described
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text" name="goods_described" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

<!--                            上传图片1-->
                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>上传图片
                                </label>
                                <div class="layui-form-mid layui-word-aux">
                                    <a href="javascript:void(0)" onclick="uploadPhoto()" class="layui-btn">选择图片</a>
                                    <input type="file" id="photoFile" style="display: none;" onchange="upload()">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <a href="javascript:void(0)" onclick="uploadPhoto2()" class="layui-btn">选择图片2</a>
                                    <input type="file" id="photoFile2" style="display: none;" onchange="upload2()">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <a href="javascript:void(0)" onclick="uploadPhoto3()" class="layui-btn">选择图片3</a>
                                    <input type="file" id="photoFile3" style="display: none;" onchange="upload3()">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>图片预览
                                </label>
                                <div class="layui-form-mid layui-word-aux">
                                    <img id="preview_photo" src=""  class="layui-layer-phimg" style="height: 100px;width: 100px;">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <img id="preview_photo2" src=""  class="layui-layer-phimg" style="height: 100px;width: 100px;">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <img id="preview_photo3" src=""  class="layui-layer-phimg" style="height: 100px;width: 100px;">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_small_logo
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text" name="goods_small_logo" required=""
                                           autocomplete="off" class="layui-input" value="" id="myvalue">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_small_logo2
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="goods_small_logo2" required=""
                                           autocomplete="off" class="layui-input" value="" id="myvalue2">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>goods_small_logo3
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="goods_small_logo3" required=""
                                           autocomplete="off" class="layui-input" value="" id="myvalue3">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>cat_one_id
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="cat_one_id" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>Integer类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>cat_two_id
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="cat_two_id" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>Integer类型
                                </div>
                            </div>

<!--                            <div class="layui-form-item">-->
<!--                                <label  class="layui-form-label">-->
<!--                                    <span class="x-red">*</span>goods_serial-->
<!--                                </label>-->
<!--                                <div class="layui-input-inline">-->
<!--                                    <input type="text"  name="goods_serial" required=""-->
<!--                                           autocomplete="off" class="layui-input">-->
<!--                                </div>-->
<!--                                <div class="layui-form-mid layui-word-aux">-->
<!--                                    <span class="x-red">*</span>String类型-->
<!--                                </div>-->
<!--                            </div>-->

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>openid
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="openid" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>String类型
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                    <span class="x-red">*</span>status
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="status" required=""
                                           autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    <span class="x-red">*</span>Integer类型
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label  class="layui-form-label">
                                </label>
                                <button  class="layui-btn" lay-filter="add" lay-submit="" type="submit">
                                    增加
                                </button>
                                <a class="layui-btn" th:href="@{/Booklist}">
                                    <i class="layui-icon">&#xe60c;</i>返回
                                </a>
                            </div>
                        </form>
                        <!-- 右侧内容框架，更改从这里结束 -->
                    </div>
                </div>
                <!-- 右侧主体结束 -->
            </div>
            <!-- 中部结束 -->
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>
    </div>
    <!-- 右侧主体结束 -->
</div>
<!-- 中部结束 -->

<!--引入底部-->
<div th:insert="~{commons/commons::mybottom}"></div>
<!--引入背景-->
<div th:insert="~{commons/commons::mybackground}"></div>

<script src="http://cdn.bootcss.com/echarts/3.3.2/echarts.min.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/echarts-for-x-admin.js"></script>

<!--处理上传图片-->
<script>

    function uploadPhoto() {
        $("#photoFile").click();
    }
    function upload() {
        if ($("#photoFile").val() == '') {
            return;
        }
        var formData = new FormData();
        formData.append('file', document.getElementById('photoFile').files[0]);
        $.ajax({
            // url:"${pageContext.request.contextPath}/fileUpload",
            url:"/fileUpload",
            type:"post",
            data: formData,
            contentType: false,
            processData: false,
            success: function(data) {
                $("#preview_photo").attr("src", data.filename);
                $("#myvalue").attr("value",data.filename)
            },
            error:function(data) {
                alert("上传失败")
            }
        });
    }


    function uploadPhoto2() {
        $("#photoFile2").click();
    }
    function upload2() {
        if ($("#photoFile2").val() == '') {
            return;
        }
        var formData = new FormData();
        formData.append('file', document.getElementById('photoFile2').files[0]);
        $.ajax({
            // url:"${pageContext.request.contextPath}/fileUpload",
            url:"/fileUpload",
            type:"post",
            data: formData,
            contentType: false,
            processData: false,
            success: function(data) {
                $("#preview_photo2").attr("src", data.filename);
                $("#myvalue2").attr("value",data.filename)
            },
            error:function(data) {
                alert("上传失败")
            }
        });
    }

    function uploadPhoto3() {
        $("#photoFile3").click();
    }
    function upload3() {
        if ($("#photoFile3").val() == '') {
            return;
        }
        var formData = new FormData();
        formData.append('file', document.getElementById('photoFile3').files[0]);
        $.ajax({
            // url:"${pageContext.request.contextPath}/fileUpload",
            url:"/fileUpload",
            type:"post",
            data: formData,
            contentType: false,
            processData: false,
            success: function(data) {
                $("#preview_photo3").attr("src", data.filename);
                $("#myvalue3").attr("value",data.filename)
            },
            error:function(data) {
                alert("上传失败")
            }
        });
    }
</script>
</body>
</html>